const mysql = require('mysql');
const $ = require('./config');
var connection = mysql.createConnection({
  host     : $.DB.host,
  user     : $.DB.user,
  password : $.DB.password,
  database : $.DB.database
});
 
connection.connect();
 
connection.query('select * from hyzx', function (error, results, fields) {
  if (error) throw error;
  console.log('The solution is: ', results);
});
connection.query("INSERT INTO hyzx(`desc`) VALUES(?)" , ['测试'], function(error, results, fields){
	if(error){
		console.log(error.message);
	}
	console.log(results);
})